package 进制转换;

import java.util.Scanner;

public class 十转八 {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int n = scanner.nextInt();
        String a = Integer.toOctalString(n);
        if (n==0){
            System.out.println(0);
        }else {
            System.out.println(0+a);
        }

    }
}
